#pragma once

class ISimulatorControl
{
public:
	ISimulatorControl(void) {}
	virtual ~ISimulatorControl(void) {}

	virtual int getSensorValue(int port)=0;
	virtual void setSensorMode(int port, bool active)=0;

	virtual void setLightBrightness(int port, int level)=0;
	virtual void setLightStatus(int port, bool on)=0;

	virtual int getBatteryValue()=0;
	virtual int getKeyStatus(int keys, bool isPressed)=0;
	
	typedef unsigned long (*TaskDelegator)(void*);
	virtual unsigned long registKeyDelegator(TaskDelegator fp)=0;

	virtual void sendMessage(unsigned char msg)=0;
	virtual unsigned char receiveMessage(bool untilBlock)=0;
	virtual void clearMessage()=0;
	virtual int registMessageDelegator(TaskDelegator fp)=0;

	virtual void orderMotor(int port, char* methodName, int param=-1)=0;

	enum LCD_DISPLAY_MODE{
			LCD_DISPLAY_MODE_NATIVE=0,
			LCD_DISPLAY_MODE_HEX=1,
			LCD_DISPLAY_MODE_ASCII=2
		};
	virtual void cputcLCD(LCD_DISPLAY_MODE mode, char c, int pos)=0;
	virtual void cputwLCD(unsigned word)=0;
	virtual void cputsLCD(char* s)=0;
	virtual void clearLCD()=0;

	virtual void play(unsigned char pitch, unsigned char length)=0;
	virtual void setSoundDuration(unsigned int len)=0;
	virtual void setSoundInternote(unsigned int len)=0;
	virtual void stopSound()=0;
	virtual void beepSound()=0;

	virtual void setSensorName(int port, char* name)=0;
	virtual void setMotorName(int port, char* name)=0;
	virtual char* getSensorName(int port)=0;
	virtual char* getMotorName(int port)=0;

	virtual void notifyLoopCount(unsigned int count)=0;
};
